package com.tarry.strategy;

import lombok.AllArgsConstructor;
import lombok.Setter;

@AllArgsConstructor
@Setter
public class CalculateContext {
    private CalculateStrategy calculateStrategy;

    /**
     * 策略执行器
     * @param num1
     * @param num2
     * @return calc result
     * @throws Exception
     */
    public double execute(double num1,double num2) throws Exception{
        return this.calculateStrategy.doOperation(num1,num2);
    }
}
